<template>
	<view class="content b-t">
		<view class='resume_boc'>
			<view class='view1'>
				<text style="font-size: 13px;">当前金额</text>
				<text style="font-size: 18px;">{{userInfo.money}}</text>
			</view>
		</view>
		<!-- <view class="nav">
			<image class="nav_bg" src="../../static/image/nav_bg.png"></image>
			<view class="navbar flex flex_row_center flex_col_center" :style="'padding-top:' + padTop + 'px;'">
				<image class="back" src="../../static/image/arrow_right.png" @click="back"></image>
				<view class="nav_title">用户提现</view>
			</view>
		</view> -->
		<view class="row b-b">
			<text class="tit">对方手机号</text>
			<input class="input" type="text" v-model="mobile" placeholder="对方手机号" placeholder-class="placeholder" />
		</view>
		<view class="row b-b">
			<text class="tit">互充金额</text>
			<input class="input" type="text" v-model="amount" placeholder="互充金额" placeholder-class="placeholder" />
		</view>
	
		<view class="content_c">
			
			<view class="item flex flex_row_center" style="color: red; font-size: 12px;">
				最低金额为1.00元
			</view>
		</view>


		<view class="btm flex flex_row_center flex_col_center">
			<view class="btn btn_select" @click="feedback()">提交</view>
		</view>
	</view>
</template>

<script>
	import {
	    mapState 
	} from 'vuex';
	export default {
		data() {
			return {
				padTop: null,
				name: null,
				address: null,
				relation: null,
				mobile: null,
				is_check: null,
				disabled: false,
				indes: null,
				amount:'',
			};
		},
		onLoad(e) {
			this.padTop = uni.getSystemInfoSync().statusBarHeight;
			// this.queryInfo();
		},
		onShow() {
		},
		computed: {
			...mapState(['hasLogin','userInfo'])
		},
		methods: {
			
			lsidf(e) {
				console.log(e)
				this.indes = e
			},
			back() {
				uni.navigateBack();
			},
			getInfo() {
				let that = this;
				this.$api.get("/user/index").then((res) => {
					if (res.code == 1) {
						that.userInfo = res.data.data;
					
					} else {
						// uni.showToast({
						//   title: res.msg,
						//   icon: "none",
						// });
					}
				});
				//   console.log(that.userimg);
			},
			feedback() {
				var that = this;

				if (this.isEmpty(this.amount)) {
					uni.showToast({
						title: "请输入金额",
						icon: "none",
					});
					return;
				}
				
				var data = {
					num: this.amount,
					mobile:this.mobile
				}
				let result = this.$api.request("/finance/transfer", 'POST',data);
				
				if(result){
					setTimeout(function() {
						uni.navigateBack();
					}, 1000);
				}
					// console.log(rresultes)
					// if (res.code == 1) {
					// 	uni.showToast({
					// 		title: "提交成功，请耐心等待审核....",
					// 		icon: "none",
					// 	});
					// 	setTimeout(function() {
					// 		uni.navigateBack();
					// 	}, 1000);
					// } else {
					// 	uni.showToast({
					// 		title: res.msg,
					// 		icon: "none",
					// 	});
					// }
			},
			isEmpty: function(obj) {
				if (obj == null || obj == "" || typeof obj == "undefined") {
					return true;
				} else {
					return false;
				}
			},
		},
	};
</script>

<style lang="scss" scoped>
	.row {
		display: flex;
		align-items: center;
		position: relative;
		padding: 0 30upx;
		height: 110upx;
		background: #fff;
	
		.tit {
			flex-shrink: 0;
			width: 182upx;
			font-size: 30upx;
			color: $font-color-dark;
		}
	
		.input {
			flex: 1;
			font-size: 30upx;
			color: $font-color-dark;
		}
	
		.icon-shouhuodizhi {
			font-size: 36upx;
			color: $font-color-light;
		}
	}
	.resume_boc {
		width: 690rpx;
		background: #000000;
		box-shadow: 0rpx 6rpx 12rpx rgba(0, 0, 0, 0.06);
		border-radius: 20rpx;
		margin: 0 auto;
		padding: 69rpx 0 69rpx 0;
		box-sizing: border-box;
		font-size: 28rpx;
		font-weight: 400;
		color: #ffeb3b;
		position: relative;
		top: 17rpx;
		.view1{
			display: flex;
			flex-direction: column;
			/* flex-grow: 19; */
			line-height: 54rpx;
			text-align: center;
			.zcx{
				color: #9E9E9E;
			}
			.money{
				font-size: 18px;
			}
		}
		.view2{
			background: RGB(254 207 30);
			padding: 15rpx 31rpx;
			font-size: 13px;
			/* border: 14px; */
			border-radius: 64rpx 0 0 64rpx;
		}
	}
	.page {
		padding-bottom: 120upx;
	}
.content {
		position: relative;
	}
	.nav {
		width: 100%;

		.nav_bg {
			position: absolute;
			width: 100%;
			height: 270px;
		}

		.navbar {
			z-index: 999;
			position: relative;
			padding-top: constant(safe-area-inset-top);
			padding-top: env(safe-area-inset-top);
			width: 100%;
			height: 44px;
			line-height: 44px;
			font-size: 16px;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #ffffff;
		}

		.back {
			position: absolute;
			left: 15px;
			width: 24px;
			height: 24px;
		}
	}

	.content_c {
		position: relative;
		margin: 16px 12px;
		padding: 20px 24px;
		background: #ffffff;
		box-shadow: 0px 6px 6px rgba(0, 0, 0, 0.03);
		border-radius: 10px;

		.item {
			height: 46px;
			border-bottom: 1px solid #f2f2f2;
		}

		.name {
			width: 90px;
			font-size: 14px;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #333333;
		}

		.item input {
			font-size: 14px;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #333333;
		}
	}

	.btm {
		position: relative;
		/* margin: 16px 12px; */
		padding: 20px 24px;
		background: #ffffff;
		box-shadow: 0px 6px 6px rgba(0, 0, 0, 0.03);
		border-radius: 10px;

		.btn {
			height: 36px;
			font-size: 16px;
			font-family: SourceHanSansCN-Regular;
			line-height: 36px;
			color: #164C16;
			background-color: #ffffff;
			// border: 1px solid #164C16;
			border-radius: 6px;
			text-align: center;
		}

		.btn_select {
			color: #ffffff;
			background-color: #36CEBF;
		}
	}

	.qopign {
		width: 80%;
		margin: auto;
		margin-top: 20px;
		background-color: #fff;
		border-radius: 20rpx;
		height: 300px;
		padding: 10px;
		box-shadow: 0px 6px 6px rgba(0, 0, 0, 0.03);

		.ldifn {}

		.nbus {
			background-color: #164C16;
			color: #fff;
		}
	}
</style>